﻿using CodeGenerator.Console.ProjectBLService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeGenerator.Console
{
    public class DisplayProjectAction : IDisplayableAction
    {
        public void Display(int id)
        {
            UserPkDto dto = new UserPkDto();
            dto.UserId = id;

            ProjectBLClient client = new ProjectBLClient();
            List<ProjectHeaderDto> result = client.GetProjectNameByUserId(dto).Data;

            System.Console.WriteLine("");
            System.Console.WriteLine("Project ID : Project Name");
            foreach (ProjectHeaderDto p in result)
            {
                System.Console.WriteLine(p.Id.ToString() + " : " + p.Name);
            }
            System.Console.WriteLine("");
        }
    }
}
